The majority of the script entries can have constants embedded in them. These are predefined strings enclosed in brace characters { }. Setup or Uninstall translates the constants to their literal values, depending on the user's choices and system configuration. For example, {win}, as described below, would translate to "C:\WINDOWS" on most systems.
A "{" character is treated as the start of the constant. If you want to use that actual character in a place where constants are supported, you must use two consecutive "{" characters. (You do not need to double "}" characters.)
When a backslash immediately follows a constant, Setup or Uninstall will automatically remove the backslash if the value of the constant ends in a backslash already. Thus, if the value of a particular constant is "C:\", {constantname}\file will translate to "C:\file", not "C:\\file". If you want to prevent this from happening, enclose the backslash in { } characters, e.g. {app}{\}.
The following is the list of supported constants.
The application directory, which the user selects on the Select Destination Location page of the wizard.
For example: If you used {app}\MYPROG.EXE on an entry and the user selected "C:\MYPROG" as the application directory, Setup will translate it to "C:\MYPROG\MYPROG.EXE".
The system's Windows directory.
For example: If you used {win}\MYPROG.INI on an entry and the system's Windows directory is "C:\WINDOWS", Setup or Uninstall will translate it to "C:\WINDOWS\MYPROG.INI".
The system's Windows System directory (System32 on Windows NT platforms).
For example: If you used {sys}\CTL3D32.DLL on an entry and the system's Windows System directory is "C:\WINDOWS\SYSTEM", Setup or Uninstall will translate it to "C:\WINDOWS\SYSTEM\CTL3D32.DLL".
On 64-bit Windows, the system's SysWOW64 directory, typically "C:\WINDOWS\SysWOW64". This is the actual directory in which 32-bit system files reside. On 32-bit Windows, 32-bit system files reside in "System32" or "System", not in a separate SysWOW64 directory, so this constant will resolve to the same directory as {sys} if used there.
The directory in which the Setup files are located.
For example: If you used {src}\MYPROG.EXE on an entry and the user is installing from "S:\", Setup will translate it to "S:\MYPROG.EXE".
System Drive. The drive Windows is installed on, typically "C:". On Windows NT platforms, this directory constant is equivalent to the SystemDrive environment variable.
Program Files. The path of the system's Program Files directory. {pf} is equivalent to {pf32} unless the install is running in 64-bit mode, in which case it is equivalent to {pf64}.
32-bit Program Files. The path of the system's 32-bit Program Files directory, typically "C:\Program Files" on 32-bit Windows and "C:\Program Files (x86)" on 64-bit Windows.
64-bit Windows only: 64-bit Program Files. The path of the system's 64-bit Program Files directory, typically "C:\Program Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.
Common Files. The path of the system's Common Files directory. {cf} is equivalent to {cf32} unless the install is running in 64-bit mode, in which case it is equivalent to {cf64}.
32-bit Common Files. The path of the system's 32-bit Common Files directory, typically "C:\Program Files\Common Files" on 32-bit Windows and "C:\Program Files (x86)\Common Files" on 64-bit Windows.
64-bit Windows only: 64-bit Common Files. The path of the system's 64-bit Common Files directory, typically "C:\Program Files\Common Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.
Temporary directory used by Setup or Uninstall. This is not the value of the user's TEMP environment variable. It is a subdirectory of the user's temporary directory which is created by Setup or Uninstall at startup (with a name like "C:\WINDOWS\TEMP\IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when Setup or Uninstall exits. During Setup, this is primarily useful for extracting files that are to be executed in the [Run] section but aren't needed after the installation.
Fonts directory. Normally named "FONTS" under the Windows directory.
DAO directory. This is equivalent to {cf}\Microsoft Shared\DAO.
Inno Setup supports another set of directory constants, referred to as shell folder constants. They can be used in the same way as the other directory constants.
The "user" constants below refer to the currently logged in user's profile. "common" constants refer to the All Users profile.
Except where otherwise noted, shell folder constants work on all versions of Windows that Inno Setup supports, including Windows 95 and NT 4.0.
* = The "common" form of this constant is mapped to the "user" form if the logged-in user lacks administrative privileges, or if the operating system is Windows 95/98/Me.
The path to the Start Menu folder, as selected by the user on Setup's Select Start Menu Folder wizard page. On Windows NT/2000/XP/2003, this folder is always created under the All Users profile unless the user installing the application does not have administrative privileges, in which case it is created on the user's profile.
The path to the local (nonroaming) Application Data folder.
The path to the current user's Send To folder. (There is no common Send To folder.)
The path to the Application Data folder.
The path to the desktop folder.
The path to the My Documents folder (or on NT 4.0, the Personal folder).
The path to the Favorites folder. Usage of these constants requires a MinVersion setting of at least "4.1, 4". Only Windows 2000 and later supports {commonfavorites}; if used on previous Windows versions, it will translate to the same directory as {userfavorites}.
The path to the Programs folder on the Start Menu.
The path to the top level of the Start Menu.
The path to the Startup folder on the Start Menu.
The path to the Templates folder. Only Windows 2000 and later supports {commontemplates}; if used on previous Windows versions, it will translate to the same directory as {usertemplates}.
A backslash character. See the note at the top of this page for an explanation of what the difference between using {\} and only a \ is.
Embeds the value of an environment variable.
{%COMSPEC} {%PROMPT|$P$G}
The full pathname of the system's standard command interpreter. On Windows NT/2000/XP/2003, this is Windows\System32\cmd.exe. On Windows 95/98/Me, this is Windows\COMMAND.COM. Note that the COMSPEC environment variable is not used when expanding this constant.
The name of the computer the Setup or Uninstall program is running on (as returned by the GetComputerName function).
Extracts and returns the drive letter and colon (e.g. "C:") from the specified path. In the case of a UNC path, it returns the server and share name (e.g. "\\SERVER\SHARE").
{drive:{src}} {drive:c:\path\file} {drive:\\server\share\path\file}
The name of the folder the user selected on Setup's Select Start Menu Folder wizard page. This differs from {group} in that it is only the name; it does not include a path.
(Special-purpose) Translates to the window handle of the Setup program's background window.
(Special-purpose) Translates to the window handle of the Setup wizard window. This handle is set to '0' if the wizard window handle isn't available at the time the translation is done.
Embeds a value from an .INI file.
{ini:{win}\MyProg.ini,Settings,Path|{pf}\My Program}
The internal name of the selected language. See the [Languages] section documentation for more information.
Embeds a custom message value based on the active language.
{cm:LaunchProgram,Inno Setup}
The example above translates to "Launch Inno Setup" if English is the active language.
Embeds a registry value.
{reg:HKLM\Software\My Program,Path|{pf}\My Program}
Embeds a command line parameter value.
{param:Path|{pf}\My Program}
The example above translates to c:\My Program if the command line /Path="c:\My Program" was specified.
The full pathname of the Setup program file, e.g. "C:\SETUP.EXE".
The full pathname of the uninstall program extracted by Setup, e.g. "C:\Program Files\My Program\unins000.exe". This constant is typically used in an [Icons] section entry for creating an Uninstall icon. It is only valid if Uninstallable is yes (the default setting).
The name and organization, respectively, that Windows is registered to. This information is read from the registry.
The name, organization and serial number, respectively, that the user entered on the User Information wizard page (which can be enabled via the UserInfoPage directive). Typically, these constants are used in [Registry] or [INI] entries to save their values for later use.
The name of the user who is running Setup or Uninstall program (as returned by the GetUserName function).